package com.yidu.t299.service.xp.impl;
import com.yidu.t299.dao.xp.StucatabolizeManageMapper;
import com.yidu.t299.domain.xp.*;
import com.yidu.t299.domain.xp.Class;
import com.yidu.t299.service.xp.StucatabolizeManageBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * @descripion:
 * @auth: XuPan
 * @date: 2023/3/13 8:39
 * @version: 1.0
 */
@Service
@Transactional
public class StucatabolizeManageBizImpl implements StucatabolizeManageBiz {
    @Autowired
    private StucatabolizeManageMapper stucatabolizeManageMapper;//注入数据

    @Override
    public int deleteByPrimaryKey(Integer stucataId) {
        return stucatabolizeManageMapper.deleteByPrimaryKey(stucataId);
    }

    @Override
    public int insert(StucatabolizeManage record) {
        return stucatabolizeManageMapper.insert(record);
    }

    @Override
    public StucatabolizeManage selectByPrimaryKey(Integer stucataId) {
        return stucatabolizeManageMapper.selectByPrimaryKey(stucataId);
    }

    @Override
    public List<StucatabolizeManage> selectByPage(int rows, int page, String condition) {
        return stucatabolizeManageMapper.selectByPage(rows, page, condition);
    }

    @Override
    public int selectCount(String condition) {
        return stucatabolizeManageMapper.selectCount(condition);
    }

    @Override
    public int updateByPrimaryKey(StucatabolizeManage record) {
        return stucatabolizeManageMapper.updateByPrimaryKey(record);
    }

    @Override
    public String getCondition(StucatabolizeManage stucatabolizeManage) {
        //定义条件字符串变量，初始值为空格字符串
        String condition = " ";
        //如果退班对象为空则直接返回条件字符串
        if (stucatabolizeManage == null){
            return condition;
        }
        if (stucatabolizeManage.getStudentName() != null && stucatabolizeManage.getStudentName().trim().length()!=0){
            condition += " and student_name like '%" + stucatabolizeManage.getStudentName() + "%'";
        }
        //返回条件字符串
        return condition;
    }
    @Override
    public List<School> selectAllGetSchoolName() {
        return stucatabolizeManageMapper.selectAllGetSchoolName();
    }

    @Override
    public List<Class> selectAllGetClassName() {
        return stucatabolizeManageMapper.selectAllGetClassName();
    }

    @Override
    public List<Record> selectAllGetRecordName() {
        return stucatabolizeManageMapper.selectAllGetRecordName();
    }

    @Override
    public int selectBySchoolName(String schoolName) {
        return stucatabolizeManageMapper.selectBySchoolName(schoolName);
    }

    @Override
    public int selectByClassName(String className) {
        return stucatabolizeManageMapper.selectByClassName(className);
    }

    @Override
    public int selectByRecordName(String recordName) {
        return stucatabolizeManageMapper.selectByRecordName(recordName);
    }
}
